package com.jzh.eurekaconsumerfeign.controller;

import com.jzh.eurekaconsumerfeign.service.ConfigClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ConfigController {
    @Autowired
    private ConfigClient configClient;
    @RequestMapping(value = "/from" ,method = RequestMethod.GET)
    public String from() {

        return configClient.from();
    }

    /**
     * 测试本地配置文件和远程配置文件同时存在时，哪个优先级更高
     * @return
     */
    @RequestMapping(value = "/regFetIntSec" ,method = RequestMethod.GET)
    public String regFetIntSec() {

        return configClient.regFetIntSec();
    }
}
